package com.jy.modules.cims.data.dao;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.jy.modules.cims.data.common.dto.TCMmQuotaCreditDetailDTO;
import com.jy.modules.cims.data.common.dto.TCMmQuotaLoanDetailDTO;
import com.jy.modules.cims.data.dto.CustInfoDto;
import com.jy.modules.cims.data.dto.QuotaCreditDetailDto;
import com.jy.modules.cims.data.dto.QuotaCreditRightDto;
import com.jy.modules.cims.data.dto.QuotaDto;
import com.jy.platform.core.mybatis.MyBatisRepository;

/**
 * 额度实体
 */
@MyBatisRepository
public interface QuotaDao {
    
    /**
     * @author JY-IT-D001
     * @description: 分页查询
     * @date 2015-01-09 09:47:20
     * @param searchParams
     * @return
     */
    public List<QuotaDto> searchQuotaByPaging(Map<String, Object> searchParams) ;
    /**
     * @author lizhiqiang
     * @description: 分页查询
     * @date 2015-01-09 09:47:20
     * @param searchParams
     * @return
     */
    public List<QuotaCreditDetailDto> searchQuotaCreditDetailByPaging(Map<String, Object> searchParams) ;
    
    /**
     * @author lizhiqiang
     * @description: 查询
     * @date 2015-01-09 09:47:20
     * @param searchParams
     * @return
     */
    public List<QuotaCreditDetailDto> searchQuotaCreditDetail(Map<String, Object> searchParams) ;
    /**
     * 统计标的日期债权价值
     * @Title searchTotalQuotaCreditDetail
     * @Description TODO
     * @param searchParams
     * @return 
     * Integer 
     * @author lizhiqiang
     * @date 2015-8-13-下午8:31:43
     * @update 
     * @throws
     */
    public BigDecimal searchTotalQuotaCreditDetail(Map<String, Object> searchParams);
    /**
     * @author JY-IT-D001
     * @description:查询对象
     * @date 2015-01-09 09:47:20
     * @param searchParams
     * @return
     */
    public List<QuotaDto> searchQuota(Map<String,Object> searchParams);

    /**
     * @author JY-IT-D001
     * @description:查询对象
     * @date 2015-01-09 09:47:20
     * @param id
     * @return
     */
    public QuotaDto findQuotaByPrimaryKey(String id);
    /**
     * 
     * @author zhangmi
     * @date  2017年2月23日
     * @param searchParams
     * @return
     */
    public List<QuotaDto> findQuotaCodeAutoPretend(Map<String,Object> searchParams);
    
    /**
     * @author JY-IT-D001
     * @description: 新增对象
     * @date 2015-01-09 09:47:20
     * @param paramMap
     * @return
     */
    public int insertQuota(Map<String, Object> paramMap);
    
    /**
     * @author JY-IT-D001
     * @description: 更新对象
     * @date 2015-01-09 09:47:20
     * @param paramMap
     */
    public void updateQuota(Map<String, Object> paramMap);
    /**
     * 批量保存额度申请债权明细
     * @Title insertTCMmQuotaCreditDetails
     * @Description TODO
     * @param paramMap 
     * void 
     * @author lizhiqiang
     * @date 2015-1-27-下午7:51:27
     * @update 
     * @throws
     */
    public void insertTCMmQuotaCreditDetails(List<QuotaCreditRightDto> list);
     
    /**
     * @author JY-IT-D001
     * @description: 按主键删除
     * @date 2015-01-09 09:47:20
     * @param ids
     * @return
     */ 
    public void deleteQuotaByPrimaryKey(Map<String, Object> paramMap);
    
    /**
     * 根据额度作废债权明细
     * @param quotaCode 
     * @return void
     * @author chenguixue
     * @date 2015-1-30-下午2:20:04
     * @update
     */
    public void cancelQuotaCRDetailByQuota(Map<String, Object> paramMap);
    
    /**
     * 异常状态回滚
     * @Title dobackCancelQuotaCRDetailByQuota
     * @Description TODO
     * @param paramMap 
     * void 
     * @author lizhiqiang
     * @date 2016-5-19-下午6:05:56
     * @update 
     * @throws
     */
    public void dobackCancelQuotaCRDetailByQuota(Map<String, Object> paramMap);
    
    
    
    
    /**
     * 根据额度作废贷款明细
     * @param quotaCode 
     * @return void
     * @author chenguixue
     * @date 2015-1-30-下午2:20:04
     * @update
     */
    public void cancelQuotaLoanDetailByQuota(Map<String, Object> paramMap);
    
    /**
     * 根据额度合同号作废贷款明细
     * @param quotaCode 
     * @return void
     * @update
     */
    public void cancelQuotaLoanDetailByContractNo(Map<String, Object> paramMap);
    
    /**
	 * @author JY-IT-D001
	 * @description: 根据quota_code字段的值，更新 validate_state字段值
	 * @date 2015-01-09 09:47:20
	 * @param paramMap
	 * @return
	 */
	public void updateValidateStateByQuotaCode(Map<String, Object> paramMap);

	/**
	 * @author JY-IT-D001
	 * @description: 根据invalid_date字段的值，更新 validate_state字段值
	 * @date 2015-01-09 09:47:20
	 * @param paramMap
	 * @return
	 */
	public void updateValidateStateByInvalidDate(Map<String, Object> paramMap);
	
	/**
	 * 获取额度作废债权明细
	 * @param paramMap 
	 * @return void
	 * @author chenguixue
	 * @date 2015-1-30-下午4:13:04
	 * @update
	 */
	public List<TCMmQuotaCreditDetailDTO> findCancelQuotaCRDetailByQuota(Map<String, Object> paramMap);
	
	/**
	 * 获取额度作废贷款明细
	 * @param paramMap 
	 * @return void
	 * @author chenguixue
	 * @date 2015-1-30-下午4:13:13
	 * @update
	 */
	public List<TCMmQuotaLoanDetailDTO> findCancelQuotaLoanDetailByQuota(Map<String, Object> paramMap);
	
	/**
	 * 删除额度主表处理
	 * @param searchParams 
	 * @return void
	 * @author chenguixue
	 * @date 2015-1-30-下午4:46:59
	 * @update
	 */
	public void cancelQuota(Map<String, Object> searchParams);
    /**
     * 
     * @Title getQuotaCreditRightDto
     * @Description TODO
     * @param paramMap
     * @return 
     * List<QuotaCreditRightDto> 
     * @author lizhiqiang
     * @date 2015-1-30-上午11:55:10
     * @update 
     * @throws
     */
    public List<TCMmQuotaCreditDetailDTO> getQuotaCreditRightDtoByTransferIds(Map<String, Object> paramMap);
    /**
     * 用合同编号查询额度申请贷款信息
     * @Title getQuotaLoanDtoByContractNos
     * @Description TODO
     * @param paramMap
     * @return 
     * List<TCMmQuotaLoanDetailDTO> 
     * @author lizhiqiang
     * @date 2015-2-1-下午4:02:05
     * @update 
     * @throws
     */
    public List<TCMmQuotaLoanDetailDTO> getQuotaLoanDtoByContractNos(Map<String, Object> paramMap);
    
    /**
     * 批量插入额度明细的客户信息
     * @param list 
     * @return void
     * @author chenguixue
     * @date 2015-2-7-下午1:47:21
     * @update
     */
    public void insertCustInfoDetails(List<CustInfoDto> list);
    
    /**
     * 使用额度申请编号更新
     * @Title updateQuotaCreditDetailByQuotaCode
     * @Description TODO
     * @param paramMap 
     * void 
     * @author lizhiqiang
     * @date 2015-4-18-下午1:48:48
     * @update 
     * @throws
     */
    public void updateQuotaCreditDetailByQuotaCode(Map<String, Object> paramMap);
    /**
     * @author JY-IT-D001
     * @description:查询对象t_c_mm_quota_credit_detail
     * @date 2015-02-04 15:48:31
     * @param id
     * @return
     */
    public QuotaCreditDetailDto findTCMmQuotaCreditDetailByPrimaryKey(String id);
    
    /**
     * 根据额度申请编号，更新申请状态
     * @param paramMap
     * @author yujiazheng
     */
    public void updateQuotaStatusByQuotaCode(Map<String, Object> paramMap);
    
    
    /**
     * 根据额度申请编号，更新申请金额
     * @param paramMap
     * @author 
     */
    public void updateQuotaSumByQuotaCode(Map<String, Object> paramMap);
}